package com.sgq.vue.service.picture.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sgq.vue.dao.picture.PlateMapper;
import com.sgq.vue.entity.picture.Plate;
import com.sgq.vue.service.picture.PlateService;
import org.springframework.stereotype.Service;

/**
 * @author: 83778
 * @date: 2024-01-04 18:59
 * @desc:
 */
@Service
public class PlateServiceImpl extends ServiceImpl<PlateMapper, Plate> implements PlateService {
    @Override
    public Long findPlateIdByName(String plateName) {
        return this.findPlateByName(plateName).getId();
    }

    private Plate findPlateByName(String name){
        LambdaQueryWrapper<Plate> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Plate::getName,name);
        return this.baseMapper.selectOne(queryWrapper);
    }
}
